package 补充.多线程;
class SubThread2 extends Thread{
    public SubThread2(String name){
        super(name);
    }
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            if (i % 2 == 0) {
                System.out.println(Thread.currentThread().getName() + ":" + i);
            }
        }
    }
}

public class 后台进程 {
    public static void main(String[] args) {
        SubThread2 st=new SubThread2("新线程");
        st.setDaemon(true);
        st.start();
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName() + ":" + i);
        }
    }
}
